package behavioral.pattern.myiteratior;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * @Autor: yuanyongan
 * @Description:
 * @Date 2023/1/10 9:28
 */
public class Test {
    public static void main(String[] args) {
        ArrayList<Integer> list = new ArrayList<>();
        for (int i = 0; i < 5; ++i){
            list.add(i);
        }
        MyIterator<Integer> iterator = new MyArrayIterator<>(list);
        while (iterator.hasNext()){
            System.out.println(iterator.currentItem());
            iterator.next();
        }

    }
}
